# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=domained
pkgver=80.d9d079c
pkgrel=7
pkgdesc='Multi Tool Subdomain Enumeration.'
groups=('blackarch' 'blackarch-recon' 'blackarch-automation')
arch=('any')
url='https://github.com/TypeError/domained'
license=('GPL3')
depends=('python' 'python-colorama' 'python-requests' 'ldns' 'go' 'sublist3r'
         'knock' 'subbrute' 'massdns' 'recon-ng' 'amass' 'subfinder')
makedepends=('git')
source=("git+https://github.com/TypeError/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md docs/*.rst

  rm -rf README.md LICENSE Requirements.txt docs

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

